/**
 * @fileOverview
 * @author iNahoo
 * @since 2019/12/18.
 */

const Matrix = require('../bitmap/Matrix');

const a = new Matrix([
    3, -1, -1, 2,
    -5, 1, 3, -4,
    2, 0, 1, -1,
    1, -5, 3, -3,
], 4, 4);

let times = 1;

const b = Matrix.DiagonalMatrix([1, 3, 3, 3]);
times *= 3 * 3 * 3;

b.patch(1, 0, 5);
b.patch(2, 0, -2);
b.patch(3, 0, -1);

const a2 = Matrix.multiplication(b, a);
// a2.log();

const c = Matrix.DiagonalMatrix([1, 1, -2, -2]);
times *= -2 * -2;
c.patch(2, 1, -2);
c.patch(3, 1, 14);

const a3 = Matrix.multiplication(c, a2);
// a3.log();

const d = Matrix.DiagonalMatrix([1, 1, 1, -18]);
times *= -18;
d.patch(3, 2, -36);

const a4 = Matrix.multiplication(d, a3);
a4.log();

console.log({times});

console.log(a4.get(1,1)*a4.get(2,2)*a4.get(3,3)*a4.get(0,0)/times);

/**
 Expect

 30

 **/
